﻿using JinianNet.JNTemplate.Nodes;
using System;
using System.Collections.Generic;
using System.Text;

namespace JinianNet.JNTemplate.Parsers
{
    /// <summary>
    /// 
    /// </summary>
    public class ReturnParser : ITagParser
    {
        #region ITagParser 成员
        /// <summary>
        /// 分析标签
        /// </summary>
        /// <param name="parser">TemplateParser</param>
        /// <param name="tc">Token集合</param>
        /// <returns></returns>
        public ITag Parse(TemplateParser parser, TokenCollection tc)
        {
            if (tc != null
                && parser != null
                && tc.Count > 0
                && Utility.IsEqual(tc.First.Text, Field.KEY_RETURN))
            {
                return new ReturnTag();
            }
            return null;
        }
        #endregion
    }
}
